package com.test.smartcampusapi.service;

import com.test.smartcampusapi.entity.Card;
import com.test.smartcampusapi.mapper.CardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Date : 4/23/2022 12:18 AM
 * Author : lingy
 * Description : ...
 */
@Service
public class CardService {
    @Autowired
    private CardMapper cardMapper;

    public void createCard(String cardNumber, String cardRegistryDate) {
        cardMapper.createCard(cardNumber, cardRegistryDate);

    }

    public void updateCardStatus(String cardNumber, String status) {
        cardMapper.updateCardStatus(cardNumber, status);
    }


    public void updateCredit(String cardNumber, double amount) {
        cardMapper.updateCredit(cardNumber, amount);

    }

    public double getCredit(String cardNumber) {
        return cardMapper.getCredit(cardNumber);
    }

    public List<Card> getAllCards(){
        return cardMapper.getAllCards();
    }


}
